package com.promise.jokerdream.model.misty

/**
 * 幻境地图信息
 * 存储每个地图的详细信息
 */
data class MistyMapInfo(
    val name: String,
    val bossId: Int
)

/**
 * 幻境映射关系
 * 存储幻境地图ID与地图信息的对应关系
 */
object MistyMapping {
    
    /**
     * 幻境地图ID到地图信息的映射
     */
    private val mapIdToMapInfo = mapOf(
        1 to MistyMapInfo(name = "乐斗村", bossId = 6014),
        2 to MistyMapInfo(name = "林松郊外", bossId = 6034),
        3 to MistyMapInfo(name = "林松城", bossId = 6054),
        4 to MistyMapInfo(name = "东海龙宫", bossId = 6074),
        5 to MistyMapInfo(name = "踏云镇", bossId = 6094),
        6 to MistyMapInfo(name = "摩云山", bossId = 6114),
        7 to MistyMapInfo(name = "洞庭湖", bossId = 6134),
        8 to MistyMapInfo(name = "苍莽山", bossId = 6154),
        9 to MistyMapInfo(name = "玉龙湿地", bossId = 6174),
        10 to MistyMapInfo(name = "玉龙雪山", bossId = 6194),
        11 to MistyMapInfo(name = "狂沙台地", bossId = 6214),
        12 to MistyMapInfo(name = "回声遗迹", bossId = 6234),
        13 to MistyMapInfo(name = "悲叹沙丘", bossId = 6254),
        14 to MistyMapInfo(name = "黄沙漩涡", bossId = 6274),
        15 to MistyMapInfo(name = "炎之洞窟", bossId = 6294),
        16 to MistyMapInfo(name = "程管小镇", bossId = 6314),
        17 to MistyMapInfo(name = "花果山", bossId = 6334),
        18 to MistyMapInfo(name = "藏剑山庄", bossId = 6354),
        19 to MistyMapInfo(name = "桃花剑冢", bossId = 6374),
        20 to MistyMapInfo(name = "鹅王的试炼", bossId = 6394)
    )
    
    /**
     * 根据地图ID获取地图信息
     * @param mapId 地图ID
     * @return 对应的地图信息，如果不存在返回null
     */
    fun getMapInfoById(mapId: Int): MistyMapInfo? {
        return mapIdToMapInfo[mapId]
    }
    
    /**
     * 根据地图ID获取地图名称
     * @param mapId 地图ID
     * @return 对应的地图名称，如果不存在返回null
     */
    fun getNameById(mapId: Int): String? {
        return mapIdToMapInfo[mapId]?.name
    }
    
    /**
     * 根据地图ID获取Boss ID
     * @param mapId 地图ID
     * @return 对应的Boss ID，如果不存在返回null
     */
    fun getBossIdById(mapId: Int): Int? {
        return mapIdToMapInfo[mapId]?.bossId
    }
    
    /**
     * 获取所有地图ID
     * @return 所有地图ID的列表
     */
    fun getAllMapIds(): List<Int> {
        return mapIdToMapInfo.keys.toList()
    }
    
    /**
     * 获取所有地图名称
     * @return 所有地图名称的列表
     */
    fun getAllNames(): List<String> {
        return mapIdToMapInfo.values.map { it.name }
    }
    
    /**
     * 获取所有地图的ID-名称格式
     * @return 所有地图的"ID-名称"格式列表
     */
    fun getAllIdNameFormats(): List<String> {
        return mapIdToMapInfo.entries.map { (id, info) -> "$id-${info.name}" }
    }
    
}
